<template>
  <div class="container">
    <van-nav-bar title="查货人" fixed @click-left="onClickLeft">
      <van-icon name="arrow-left" slot="left" color="#333" size="0.6rem" />
    </van-nav-bar>
      <van-field v-model="check" label="查货人" placeholder="请输入" input-align="right" />
      <van-field v-model="checkPhone" type="number" maxlength="11" label="查货电话" placeholder="请输入" input-align="right" />
      <div class="buton">
      <van-button class="butonT" type="primary" @click="onOK" size="large">确定</van-button>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return {
      check: '',
      checkPhone:'',
      query:{}
    }
  },
  created(){
    this.query = this.$router.history.current.query;
    if(JSON.parse(sessionStorage.getItem('check'))){
      let check = JSON.parse(sessionStorage.getItem('check'))
      this.check = check.stockingGoodsMan
      this.checkPhone = check.stockingGoodsMobile
    }
  },
  methods:{
    onClickLeft() {
      this.$router.back();
    },
    onOK(){
      let list = {
        stockingGoodsMan: this.check,
        stockingGoodsMobile: this.checkPhone
      }
      console.log(list)
      sessionStorage.setItem('check', JSON.stringify(list))
      this.$router.back();
    }
  }
};
</script>

<style lang="scss" scoped>
.container{
  padding: 54px 18px 10px 18px;
  box-sizing: border-box;
  overflow: scroll;
  // font-size: 12px;
  width: 100%;
  height: 100%;
}
.buton {
  padding: 8px 8px;
  box-sizing: border-box;
  display: flex;
  border-radius: 5px;
  justify-content: space-around;
  background: #fff;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  .butonT {
    background: #f18d00;
    width: 328px;
    height: 44px;
    border-radius: 5px;
    border: 1px solid #f18d00;
  }
}
</style>